/* symtab.h
 *
 * Holds function definitions for the symbol table. The symbol table
 * is implemented as a global hash table that contains local symbol
 * tables for each function
 */

#ifndef SYMTAB_H
#define SYMTAB_H

#include "shared.h"
#include "usrdef.h"
#include <stdlib.h>
#include <string.h>

#define SYM_TYPE_CONST  2
#define SYM_TYPE_TEMP	1
#define SYM_TYPE_USER 	0

struct cfg_symtab_elem 
{
	int key;
	char * val;
	int type;
	struct cfg_symtab_elem * next;
	int marked;
};

struct cfg_symtab_elem * cfg_symtab;

/* ----------------------------------------------------------------
 * Function declarations
 * ----------------------------------------------------------------
 */


void cfg_symtab_init();
void cfg_symtab_print();
void cfg_symtab_add(int type, int key, char * val); 
struct cfg_symtab_elem * cfg_symtab_lookup(int key);
char * cfg_symtab_get_val(int key);
void cfg_symtab_remove_key(int key);
int cfg_symtab_is_userdef(int key);
void cfg_symtab_reinit_mark();

#endif
